package client.comm.baoding.ui

import android.content.pm.PackageManager
import client.comm.baoding.BaseMiddleActivity
import client.comm.baoding.R
import client.comm.baoding.databinding.ActivityAboutBinding
import client.comm.baoding.ui.vm.AboutViewModel

/**
 * 关于
 */
class AboutActivity : BaseMiddleActivity<AboutViewModel, ActivityAboutBinding>() {

    override fun getLayout(): Int {
        return R.layout.activity_about
    }

    override fun initViewModel(): AboutViewModel = createViewModel()

    override fun initView() {
        binding?.apply {
            event = this@AboutActivity
            vm = viewModel

        }
    }

    override fun initData() {
        super.initData()

        try {
            val name = packageManager
                .getPackageInfo(packageName, 0).versionName
            binding.versionName = "v" + name
        } catch (ex: PackageManager.NameNotFoundException) {
        }

    }

}